Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selectable Nodes Delegate #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jz709u
Copy link

@jz709u jz709u commented Feb 1, 2017

-PointSelectedProtocol triggers on touch of node or bar
-changes to touchEnded when user lifts off at any points or bars then
return the label, value, and the point at which selected
-this is used for display for purposes or for presenting a popup at the
point location.

-PointSelectedProtocol triggers on touch of node or bar
-changes to touchEnded when user lifts off at any points or bars then
return the label, value, and the point at which selected
-this is used for display for purposes or for presenting a popup at the
point location.
@smitaAcellere
Copy link

I did it. Thank you so much. You save my time.

@manuel21
Copy link

Hello this code has an issue that crash the app

// left point only
let leftPoint = graphPoints[leftDataPointIndex].location **//EXC_BAD_INSTRUCTION
![screen shot 2017-04-28 at 1 24 33 pm](https://cloud.githubusercontent.com/assets/7534410/25541951/363f686a-2c16-11e7-9123-c0daa320d608.png)
![screen shot 2017-04-28 at 1 24 33 pm](https://cloud.githubusercontent.com/assets/7534410/25541963/4244faee-2c16-11e7-853f-1512fb99725b.png)

**

        if shouldDrawBarLayer {
            let barWidthToRightOfX = locationOfTouchPoint.x + (barWidth / 2)
            if locationOfTouchPoint.y < leftPoint.y &&
                barWidthToRightOfX > locationOfTouchPoint.x {
                triggerDelegateWith(index: leftDataPointIndex)
            }

fatal error: Index out of range

The index is wrong when I Tap on the background instead of a point

@mithunmathew1990
Copy link

Please review #82
@manuel21 @philackm @jz709u

Copy link

@mithunmathew1990 mithunmathew1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In func triggerDelegateWith(index: Int) {
guard 0 <= index && index <= (labels.count - 1) else { return }

Isn't it supposed to be
guard 0 <= index || index > (labels.count - 1) else { return }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants